package com.junqson.je.common;

import com.junqson.je.common.model.User;

/**
 * @Descriptions
 * @Company
 * @Author Junqson
 * @Date 2020/1/20 10:18
 * @Version 1.0
 */
public class UserHolder {
    private static final ThreadLocal<User> userThreadLocal = new ThreadLocal<>();

    public static User get() {
        return userThreadLocal.get();
    }

    public static void set(User user) {
        userThreadLocal.set(user);
    }

    public static void remove() {
        userThreadLocal.remove();
    }
}
